font-size: 10pt;
}
+/* Restart message */
+.restart-message {
+ font-size: 14pt;
+}
+
/* ShellMountOperation Dialogs */
.shell-mount-operation-icon {
icon-size: 48px;
reactive: true });
this.addChrome(this._coverPane);
- if (Main.sessionMode.isGreeter) {
+ if (Meta.is_restart()) {
+ // On restart, we don't do an animation
+ } else if (Main.sessionMode.isGreeter) {
this.panelBox.translation_y = -this.panelBox.height;
} else {
this._updateBackgrounds();
},
_startupAnimation: function() {
- if (Main.sessionMode.isGreeter)
+ if (Meta.is_restart())
+ this._startupAnimationComplete();
+ else if (Main.sessionMode.isGreeter)
this._startupAnimationGreeter();
else
this._startupAnimationSession();
const ExtensionDownloader = imports.ui.extensionDownloader;
const Keyboard = imports.ui.keyboard;
const MessageTray = imports.ui.messageTray;
+const ModalDialog = imports.ui.modalDialog;
const OsdWindow = imports.ui.osdWindow;
const Overview = imports.ui.overview;
const Panel = imports.ui.panel;
overview.toggle();
}));
+ global.display.connect('show-restart-message', function(display, message) {
+ showRestartMessage(message);
+ return true;
+ });
+
+ global.display.connect('restart', function() {
+ global.reexec_self();
+ return true;
+ });
+
// Provide the bus object for gnome-session to
// initiate logouts.
EndSessionDialog.init();
GLib.Source.set_name_by_id(_deferredTimeoutId, '[gnome-shell] _runAllDeferredWork');
}
}
+
+const RestartMessage = new Lang.Class({
+ Name: 'RestartMessage',
+ Extends: ModalDialog.ModalDialog,
+
+ _init : function(message) {
+ this.parent({ shellReactive: true,
+ styleClass: 'restart-message',
+ shouldFadeIn: false,
+ destroyOnClose: true });
+
+ let label = new St.Label({ text: message });
+
+ this.contentLayout.add(label, { x_fill: false,
+ y_fill: false,
+ x_align: St.Align.MIDDLE,
+ y_align: St.Align.MIDDLE });
+ this.buttonLayout.hide();
+ }
+});
+
+function showRestartMessage(message) {
+ let restartMessage = new RestartMessage(message);
+ restartMessage.open();
+}
styleClass: null,
keybindingMode: Shell.KeyBindingMode.SYSTEM_MODAL,
shouldFadeIn: true,
+ shouldFadeOut: true,
destroyOnClose: true });
this.state = State.CLOSED;
this._keybindingMode = params.keybindingMode;
this._shellReactive = params.shellReactive;
this._shouldFadeIn = params.shouldFadeIn;
+ this._shouldFadeOut = params.shouldFadeOut;
this._destroyOnClose = params.destroyOnClose;
this._group = new St.Widget({ visible: false,
return true;
},
+ _closeComplete: function() {
+ this.state = State.CLOSED;
+ this._group.hide();
+ this.emit('closed');
+
+ if (this._destroyOnClose)
+ this.destroy();
+ },
+
close: function(timestamp) {
if (this.state == State.CLOSED || this.state == State.CLOSING)
return;
this.popModal(timestamp);
this._savedKeyFocus = null;
- Tweener.addTween(this._group,
- { opacity: 0,
- time: OPEN_AND_CLOSE_TIME,
- transition: 'easeOutQuad',
- onComplete: Lang.bind(this,
- function() {
- this.state = State.CLOSED;
- this._group.hide();
- this.emit('closed');
-
- if (this._destroyOnClose)
- this.destroy();
- })
- });
+ if (this._shouldFadeOut)
+ Tweener.addTween(this._group,
+ { opacity: 0,
+ time: OPEN_AND_CLOSE_TIME,
+ transition: 'easeOutQuad',
+ onComplete: Lang.bind(this,
+ this._closeComplete)
+ })
+ else
+ this._closeComplete();
},
// Drop modal status without closing the dialog; this makes the
Main.createLookingGlass().open();
}),
- 'r': Lang.bind(this, function() {
- global.reexec_self();
- }),
+ 'r': Lang.bind(this, this._restart),
// Developer brain backwards compatibility
- 'restart': Lang.bind(this, function() {
- global.reexec_self();
- }),
+ 'restart': Lang.bind(this, this._restart),
'debugexit': Lang.bind(this, function() {
Meta.quit(Meta.ExitCode.ERROR);
}
},
+ _restart: function() {
+ this._shouldFadeOut = false;
+ this.close();
+ Meta.restart('Restarting...');
+ },
+
open: function() {
this._history.lastItem();
this._errorBox.hide();